<template>
    <!-- 详情3 -->
    <view>
        <!-- 词云分析 -->
        <card :title="'词云分析'">
            <word-cloud :content='content.word_cloud'></word-cloud>
        </card>
        <!-- 观点分析 -->
        <card :title="'观点分析'">
            <viewpoint 
                v-for='(item,index) in viewpoint_data' :key='index' 
                :title='item.title' 
                :content='item.content' 
                :index='index'></viewpoint>
        </card>
    </view>
</template>

<script>

    import card from './components/card.vue'
    import wordCloud from './components/wordCloud.vue'
    import viewpoint from './components/viewpoint.vue'

    export default {
        components: {
            card,
            wordCloud,
            viewpoint
        },
        props: {
            content: Object,
        },
        data() {
            return {
                viewpoint_data: []
            }
        },
        mounted() {
           
            this.content.viewpoint.forEach((val,i) => {
                let obj = {
                    title: this.$convert(Object.keys(val)[0]) + "观点分析",
                    content: val[Object.keys(val)[0]]
                }
                setTimeout(() => {
                    this.viewpoint_data.push(obj)
                },1000*i)
            });
        }
    }
</script>

<style lang="scss" scoped>

</style>